<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2020/3/19
  Time: 8:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css" >
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="../bootstrap/css/bootstrap-theme.min.css" >

    <title>$Title$</title>
</head>
<body>
<div class="row"><h1 style="margin-left: 200px" >学生管理系统</h1></div>
<div class="row " style="font-size:8px">
    <div class="col-xs-3 col-md-2"><jsp:include page="../Left.jsp"></jsp:include></div>
    <div class="col-xs-9 col-md-6">
               <table class="table table-striped table-condensed" style="font-size: 8px" height="5px">
                <thead>
                <tr  >
                    <td >学生ID</td>
                    <td>姓名</td>
                    <td>密码</td>
                    <td>性别</td>
                    <td>班级</td>
                    <td>生日</td>
                    <td>头像</td>
                    <td>scores</td>
                    <td>操作</td>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${pageInfo.list}" var="student">
                    <tr>
                        <td>${student.id}</td>
                        <td>${student.name}</td>
                        <td>${student.password}</td>
                        <td>${student.sex==0?'男':'女'}</td>
                        <td>${student.clazz}</td>
                        <td>${student.birthday}</td>
                        <td><img src="../image/${student.image}" class="img-circle" height="20px" width="20px"> </td>
                        <td>
                            <c:forEach items="${student.scores}" var="score">
                                ${score.course.name}  ${score.score} <br/>
                            </c:forEach>
                        </td>
                        <td><a href="delete.do?id=${student.id}">delete</a>
                            <a href="toUpdate.do?id=${student.id}">update</a>
                        </td>
                    </tr>
                </c:forEach>
                <tr>

                </tr>
                </tbody>
            </table>
        <div class="row">
            <div class="col-md-6">
                第${pageInfo.pageNum}页，共${pageInfo.pages}页，共${pageInfo.total}条记录
            </div>
            <div class="col-md-6 offset-md-4">
                <nav aria-label="Page navigation example">
                    <ul class="pagination pagination-sm">
                        <li class="page-item"><a class="page-link" href="list.do?page=1">首页</a></li>
                        <c:if test="${pageInfo.hasPreviousPage}">
                            <li class="page-item"><a class="page-link"
                                                     href="list.do?page=${pageInfo.pageNum-1}">上一页</a></li>
                        </c:if>
                        <c:forEach items="${pageInfo.navigatepageNums}" var="page">
                            <c:if test="${page==pageInfo.pageNum}">
                                <li class="page-item active"><a class="page-link" href="#">${page}</a></li>
                            </c:if>
                            <c:if test="${page!=pageInfo.pageNum}">
                                <li class="page-item"><a class="page-link"
                                                         href="list.do?page=${page}">${page}</a></li>
                            </c:if>
                        </c:forEach>
                        <c:if test="${pageInfo.hasNextPage}">
                            <li class="page-item"><a class="page-link"
                                                     href="list.do?page=${pageInfo.pageNum+1}">下一页</a></li>
                        </c:if>
                        <li class="page-item"><a class="page-link" href="list.do?page=${pageInfo.pages}">末页</a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>

        </div>

    </div>


<!-- 最新的 Bootstrap 核心 jquery 文件 -->
<script src="../bootstrap/js/jquery.js" ></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="../bootstrap/js/bootstrap.min.js" ></script>
</body>
</html>
